﻿using UnityEngine;

public class UnityInputService : IInputService
{
    public void Initialize()
    {
    }

    public InputOp HandleInput(int inputId)
    {
        InputOp inputOp = new InputOp();

        if (inputId == 1)
        {
            inputOp.forward = Input.GetKey(KeyCode.W);
            inputOp.left = Input.GetKey(KeyCode.A);
            inputOp.back = Input.GetKey(KeyCode.S);
            inputOp.right = Input.GetKey(KeyCode.D);
            inputOp.buttonA = Input.GetKey(KeyCode.U);
            inputOp.buttonB = Input.GetKey(KeyCode.I);
        }
        else
        {
            inputOp.forward = Input.GetKey(KeyCode.UpArrow);
            inputOp.left = Input.GetKey(KeyCode.LeftArrow);
            inputOp.back = Input.GetKey(KeyCode.DownArrow);
            inputOp.right = Input.GetKey(KeyCode.RightArrow);
            inputOp.buttonA = Input.GetKey(KeyCode.Keypad1);
            inputOp.buttonB = Input.GetKey(KeyCode.Keypad2);
        }

        return inputOp;
    }
}